﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _80X_CG_Frame.Objects
{
    public class User
    {
        Right r;
        string name;
        public User()
        {
            R = Right.None;
            Name = "";
        }

        public string Name { get => name; set => name = value; }
        internal Right R { get => r; set => r = value; }
        public void SetRight(string str)
        {
            switch(str)
            {
                case "Operator":
                    R = Right.Operator;
                    break;
                case "Admin":
                    R = Right.Admin;
                    break;
                default:
                    R = Right.None;
                    break;
            }
        }

        public static Right GetRight(string str)
        {
            var t_right = Right.None;
            switch (str)
            {
                case "Operator":
                    t_right = Right.Operator;
                    break;
                case "Admin":
                    t_right = Right.Admin;
                    break;
                default:
                    t_right = Right.None;
                    break;
            }
            return t_right;
        }
    }

    public enum Right
    {
        None,
        Operator,
        Admin
    }
}
